package com.wy.powerbuilder.controller.lwg;

import com.github.pagehelper.PageInfo;
import com.wy.powerbuilder.entity.lwg.houses;
import com.wy.powerbuilder.mapper.lwg.housesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class fangwuConller {
    @Autowired
    private com.wy.powerbuilder.mapper.lwg.housesMapper housesMapper;

    @Autowired
    private com.wy.powerbuilder.service.lwg.housesService housesService;



    @RequestMapping(value = {"/studento","/"})
    public String selBy(Integer pageNum, Model model, String h_state) {
        PageInfo<houses> page = housesService.selBy(pageNum, 8,h_state);
        model.addAttribute("page", page);

        if(h_state==null){
            h_state="";
        }
        model.addAttribute("name",h_state);
        return "fwuxxx";

    }





    @RequestMapping("/delltt")
    public String del(Integer h_id){
        int i = housesMapper.delete(h_id);
        System.out.println(i);
        //删除成功是不是又要进行查询
        return "redirect:/studento";
    }




}
